package ar.uba.fi.RSACryptoFiuba.view.commons;

import java.awt.Font;

import javax.swing.GroupLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.GroupLayout.Alignment;

@SuppressWarnings("serial")
public class TitlePanel extends JPanel{
	
	private JLabel titleLabel;
	private String title;
	
	public TitlePanel(String title) {
		this.title = title;
		this.initComponents();
	}
	
    private void initComponents() {
		titleLabel = new JLabel();
	    titleLabel.setFont(new Font("Ubuntu", 1, 18));
	    titleLabel.setText(title);
	    GroupLayout titlePanelLayout = new GroupLayout(this);
	    this.setLayout(titlePanelLayout);
	    titlePanelLayout.setHorizontalGroup(
	        titlePanelLayout.createParallelGroup(Alignment.LEADING)
	        .addGroup(titlePanelLayout.createSequentialGroup()
	            .addContainerGap()
	            .addComponent(titleLabel)
	            .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
	    );
	    titlePanelLayout.setVerticalGroup(
	        titlePanelLayout.createParallelGroup(Alignment.LEADING)
	        .addGroup(titlePanelLayout.createSequentialGroup()
	            .addComponent(titleLabel, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
	            .addGap(0, 12, Short.MAX_VALUE))
	    );
	}

}
